import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
import axios from 'axios'
Vue.prototype.axios=axios
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
  preLoad:1.3,
  loading:require('@/assets/loading.jpg'),
  attempt:1
})
Vue.config.productionTip = false
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  store.state.isShowLoading = true;
  return config;
});
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
  store.state.isShowLoading = false;
  return response;
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
